package enums;

public enum CellType {
	NONE,SNAKEBODY,SNAKEHEAD,SNAKETAIL,FOOD;
	
	public static boolean isSnakeHead(CellType type){
		return (type == SNAKEHEAD);
	}
	public static boolean isSnakeBody(CellType type){
		return (type == SNAKEBODY);
	}
	public static boolean isSnakeTail(CellType type){
		return (type == SNAKETAIL);
	}
	
	public static boolean isFood(CellType type){
		return (type == FOOD);
	}
	
	public static boolean isSnake(CellType type){
		return isSnakeBody(type) | isSnakeHead(type) | isSnakeTail(type);
	}
	
	public static String toString(CellType type){
		String ans;
		switch(type){
		case NONE: 		ans = "-"; break;
		case SNAKEBODY: ans = "s"; break;
		case SNAKEHEAD: ans = "S"; break;
		case SNAKETAIL: ans = "s"; break;
		case FOOD: 		ans = "f"; break;
		default: 		ans = "E"; break;
		}
		return ans;
	}
}
